<?php
	session_start();
	
	//validate user not logged in; if logged in, redirect to home
	if(isset($_SESSION['employee_id'])){
		header("location:home.php");
	}
	
	//redirect to non-mobile version if non-mobile
	include "../controller/php/mobile_handler.php";
	if(!IsMobile()) {
		header("location:../login.php");
	}
	
?>

<html>
	<head>
		<link rel="stylesheet" type="text/css" href="../view/css/mobile_application.css" />
	</head>
	<body>
		<div id="content">
			<img src="../view/img/logo2.jpg" alt="Shelly Ward Enterprises" >
			<br/>
			<center>
				<div id="error_msg">
					<p>
						<?php
							include "../controller/php/error_handler.php";
						
							if(isset($_GET['error']))
							{
								$errMsg = GetErrorMsgForId($_GET['error']);
								echo "$errMsg";
							}
						?> &nbsp;
					</p>
				</div>
				
				<br/>
				
				<form action="../controller/php/validate_login.php" method="post" id="loginFormTable">
					<table id="loginFormTable">
						<tr>
							<td>Employee Id:</td>
							<td><input type="text" name="employee_id" /></td>
						</tr>	
						<tr>
							<td>Password:</td>
							<td><input type="text" name="password" /></td>
						</tr>
						<tr>
							<td></td>
							<td><button type="submit">Login</button></td>
						</tr>
					</table>
				</form>
				
			</center>
		</div>
	</body>
</html>